Ranking and Unranking of t-ary Trees Using the Right Distance Representation
نویسندگان
چکیده
In this paper, we introduce a concise representation, called right-distance sequences (or RD-sequences for short), to describe all t-ary trees with n internal nodes. A result reveals that there exists a close relationship between the representation and the well-formated integer sequences suggested by Zaks in 1980. Using recursion tree and its concomitant tables, a systematical way can help us to investigate the structural representation of t-ary trees. Consequently, we develop efficient algorithms for determining the rank of a given t-ary tree (i.e., ranking algorithm), and for converting a positive integer to its corresponding RD-sequence (i.e., unranking algorithm). Both the ranking and unranking algorithms can be run in O(tn) time and without really building any auxiliary table. ∗All correspondence should be addressed to Professor Yue–Li Wang, Department of Computer Science and Information Engineering, National Chi Nan University, University Rd. Puli, Nantou Hsien, Taiwan 545 Republic of China (Email: [email protected]).
منابع مشابه
Ranking and Unranking of t-Ary Trees Using RD-Sequences
In this paper, we introduce a concise representation, called right-distance sequences (or RD-sequences for short), to describe all t-ary trees with n internal nodes. A result reveals that there exists a close relationship between the representation and the well-formed sequences suggested by Zaks [Lexicographic generation of ordered trees, Theoretical Computer Science 10 (1980) 63–82]. Using a c...
متن کاملParallel Generation of t-ary Trees
A parallel algorithm for generating t-ary tree sequences in reverse B-order is presented. The algorithm generates t-ary trees by 0-1 sequences, and each 0-1 sequences is generated in constant average time O(1). The algorithm is executed on a CREW SM SIMD model, and is adaptive and cost-optimal. Prior to the discussion of the parallel algorithm a new sequential generation with O(1) average time ...
متن کاملLexicographic Listing and Ranking of r-ary Trees
This paper presents three simple and efficient algorithms for generating, ranking and unranking t-ary trees in a lexicographic order. The simplest idea of encoding a t-ary tree with n nodes as a bit-string of length t*n is exploited to its full advantages. It is proved that the lexicographic order in the set of t-ary trees with n nodes is preserved in the set of bit-strings of length t*n, using...
متن کاملLexicographic Listing and Ranking of t-Ary Trees
This paper presents three simple and efficient algorithms for generating, ranking and unranking t-ary trees in a lexicographic order. The simplest idea of encoding a t-ary tree with n nodes as a bit-string of length t*n is exploited to its full advantages. It is proved that the lexicographic order in the set of t-ary trees with n nodes is preserved in the set of bit-strings of length t*n, using...
متن کاملParallel Enumeration of t–ary Trees in ASC SIMD Model
In this paper parallel algorithms are presented for enumeration and unranking of t–ary trees with n internal nodes. Generation algorithms are designed in the associative computing model ASC that belongs to a broad category of SIMD models. Tree sequences are generated in lexicographical order, with O(1) time per object, in a new representation, as combinations with repetitions with restricted gr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2006